package com.yykj.prescription.server.model.entity.setting;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Id;

@Data
@Entity
public class PrescriptionSetting {
    @Id
    private Integer hospitalId;

    @ApiModelProperty("审核方式，1自动审核 2人工审核")
    private Integer checkType = 1;

    @ApiModelProperty("是否永久有效,true 永久生效 ")
    private Boolean forever = Boolean.TRUE;

    @ApiModelProperty("生效时长，单位秒（永久有效时忽略）")
    private Integer effectiveTime = 86400;

    @ApiModelProperty("是否无穷次数： true 无穷多次 ")
    private Boolean endless = Boolean.TRUE;

    @ApiModelProperty("最大使用次数(无穷次数时忽略)")
    private Integer cnt = 0;

    @ApiModelProperty("流转后，处方是否可用，true 流转后可用，false 流转后不可用(默认)")
    private Boolean transAvailable = Boolean.FALSE;

    @ApiModelProperty("开几个处方换个人签名")
    private Integer changeMemberCnt = 5;

    @ApiModelProperty("处方台头名称，默认：医网通互联网医院")
    private String title;

    @ApiModelProperty("处方印章")
    private String sign;

    public static PrescriptionSetting defaultSetting(Integer hospitalId){
        PrescriptionSetting setting = new PrescriptionSetting();
        setting.setHospitalId(hospitalId);
        setting.setTitle("医网通互联网医院");
        setting.setSign("https://file.yaoyanglao.com/Resources/20220317/a090db01a8b24a3890915fde9e1c67e4.png");
        return setting;
    }
}
